#include<stdio.h>

#define LEN 100

int main(){
    FILE *fd;
    char buf[LEN];

    fd = fopen("hello.txt","w+");
    if(fd){
        fputs("hello world", fd);
        fclose(fd);
    }
    fd = fopen("hello.txt", "r");
    fgets(buf, LEN, fd);
    printf("%s\n", buf);
    fclose(fd);
    return 0;
}